#!usr/bin/env python
# -*- coding:utf-8 -*-
# user nanme: Mr.zhang
# data time : 2022/12/5   4:13 下午
# project   : android.py
# IDE       : PyCharm
# email     :17600960626@163.com

import uiautomator2 as u2



class Action:

    def __init__(self,devices):
        self.d = u2.connect(devices)

    def exists_xpath(self, xpaths):
        """
             判断元素是否存在
             :param xpath: xpath路径
             :return:
             """
        return self.d.xpath(xpaths).exists

    def click_by_point(self, x, y):
        """
        点击坐标点
        :param x: 横坐标
        :param y: 纵坐标
        :return:
        """
        self.d.click(x, y)
